<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>盒子变换</title>
  <style>
    .box {
      width: 200px;
      height: 200px;
      background-color: tan;

      /* CSS过渡 - 简单动画 */
      transition: all 0.4s;
    }

    .down {
      /* 变换：位移 */
      transform: translateY(100px);
    }

    .route {
      /* 变换：旋转 */
      transform: rotate(360deg);
    }
  </style>
</head>

<body>
  <button>点击动起来</button>
  <div class="box"></div>

  <script src="./lib/jquery-1.12.4.js"></script>
  <script>
    $('button').on('click', function () {
      // addClass()     添加类名(添加效果)
      // removeClass()  删除类名(删除效果)
      // toggleClass()  切换类名(切换效果)

      // $('.box').addClass('route')
      $('.box').toggleClass('route')
    })
  </script>
</body>

</html>